import App from './App'

// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
import uniIcons from '@dcloudio/uni-ui/lib/uni-icons/uni-icons.vue'
import uniNavBar from '@dcloudio/uni-ui/lib/uni-nav-bar/uni-nav-bar.vue'
import uniDrawer from '@dcloudio/uni-ui/lib/uni-drawer/uni-drawer.vue'
import uniPopup from '@dcloudio/uni-ui/lib/uni-popup/uni-popup.vue'
import uniTransition from '@dcloudio/uni-ui/lib/uni-transition/uni-transition.vue'
import uniTag from '@dcloudio/uni-ui/lib/uni-tag/uni-tag.vue'
import uniList from '@dcloudio/uni-ui/lib/uni-list/uni-list.vue'
import uniListItem from '@dcloudio/uni-ui/lib/uni-list-item/uni-list-item.vue'
import uniRefresh from '@dcloudio/uni-ui/lib/uni-list/uni-refresh.vue'
import uniLoadMore from '@dcloudio/uni-ui/lib/uni-load-more/uni-load-more.vue'
import uniCollapse from '@dcloudio/uni-ui/lib/uni-collapse/uni-collapse.vue'
import uniCollapseItem from '@dcloudio/uni-ui/lib/uni-collapse-item/uni-collapse-item.vue'
import uniSearchBar from '@dcloudio/uni-ui/lib/uni-search-bar/uni-search-bar.vue'
import FilterBar from '@/components/filter-bar/index.vue'
Vue.component('filter-bar', FilterBar)
Vue.component('uni-icons', uniIcons)
Vue.component('uni-nav-bar', uniNavBar)
Vue.component('uni-drawer', uniDrawer)
Vue.component('uni-popup', uniPopup)
Vue.component('uni-transition', uniTransition)
Vue.component('uni-tag', uniTag)
Vue.component('uni-list', uniList)
Vue.component('uni-list-item', uniListItem)
Vue.component('uni-refresh', uniRefresh)
Vue.component('uni-load-more', uniLoadMore)
Vue.component('uni-collapse', uniCollapse)
Vue.component('uni-collapse-item', uniCollapseItem)
Vue.component('uni-search-bar', uniSearchBar)

Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
  ...App
})
app.$mount()// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
import uniIcons from '@dcloudio/uni-ui/lib/uni-icons/uni-icons.vue'
import uniNavBar from '@dcloudio/uni-ui/lib/uni-nav-bar/uni-nav-bar.vue'
import uniDrawer from '@dcloudio/uni-ui/lib/uni-drawer/uni-drawer.vue'
import uniPopup from '@dcloudio/uni-ui/lib/uni-popup/uni-popup.vue'
import uniTransition from '@dcloudio/uni-ui/lib/uni-transition/uni-transition.vue'
import uniTag from '@dcloudio/uni-ui/lib/uni-tag/uni-tag.vue'
import uniList from '@dcloudio/uni-ui/lib/uni-list/uni-list.vue'
import uniListItem from '@dcloudio/uni-ui/lib/uni-list-item/uni-list-item.vue'
import uniRefresh from '@dcloudio/uni-ui/lib/uni-list/uni-refresh.vue'
import uniLoadMore from '@dcloudio/uni-ui/lib/uni-load-more/uni-load-more.vue'
import uniCollapse from '@dcloudio/uni-ui/lib/uni-collapse/uni-collapse.vue'
import uniCollapseItem from '@dcloudio/uni-ui/lib/uni-collapse-item/uni-collapse-item.vue'
import uniSearchBar from '@dcloudio/uni-ui/lib/uni-search-bar/uni-search-bar.vue'
import FilterBar from '@/components/filter-bar/index.vue'

export function createApp() {
  const app = createSSRApp(App)
  app.component('uni-icons', uniIcons)
  app.component('uni-nav-bar', uniNavBar)
  app.component('uni-drawer', uniDrawer)
  app.component('uni-popup', uniPopup)
  app.component('uni-transition', uniTransition)
  app.component('uni-tag', uniTag)
  app.component('uni-list', uniList)
  app.component('uni-list-item', uniListItem)
  app.component('uni-refresh', uniRefresh)
  app.component('uni-load-more', uniLoadMore)
  app.component('uni-collapse', uniCollapse)
  app.component('uni-collapse-item', uniCollapseItem)
  app.component('uni-search-bar', uniSearchBar)
  app.component('filter-bar', FilterBar)
return {
    app
  }
}
// #endif
